{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import graphviz\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from sklearn import tree\n",
    "from sklearn.datasets import load_wine\n",
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def load_data():\n",
    "    wine = load_wine()\n",
    "    # print(wine.data.shape)\n",
    "    win_data = pd.concat([pd.DataFrame(wine.data), pd.DataFrame(wine.target)], axis=1)\n",
    "    # print(win_data.head())\n",
    "\n",
    "    x_train, x_test, y_train, y_test = train_test_split(wine.data, wine.target, test_size=0.3)\n",
    "    return x_train, y_train, x_test, y_test\n",
    "\n",
    "\n",
    "def build_model():\n",
    "    clf = tree.DecisionTreeClassifier(criterion=\"entropy\")\n",
    "    return clf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "feature_name = ['酒精', '苹果酸', '灰', '灰的碱性', '镁', '总酚', '类黄酮', '非黄烷类酚类', '花青素', '颜 色强度', '色调', 'od280/od315稀释葡萄酒',\n",
    "                    '脯氨酸']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_tree(model):\n",
    "    dot_data = tree.export_graphviz(model,\n",
    "                                     feature_names=feature_name,\n",
    "                                     class_names=[\"琴酒\",\"雪莉\",\"贝尔摩德\"],\n",
    "                                     filled=True,\n",
    "                                     rounded=True)\n",
    "    graph = graphviz.Source(dot_data)\n",
    "    return graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9074074074074074\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.42.3 (20191010.1750)\n",
       " -->\n",
       "<!-- Title: Tree Pages: 1 -->\n",
       "<svg width=\"601pt\" height=\"433pt\"\n",
       " viewBox=\"0.00 0.00 601.00 433.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 429)\">\n",
       "<title>Tree</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-429 597,-429 597,4 -4,4\"/>\n",
       "<!-- 0 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>0</title>\n",
       "<path fill=\"#f8fefa\" stroke=\"black\" d=\"M317.5,-425C317.5,-425 209.5,-425 209.5,-425 203.5,-425 197.5,-419 197.5,-413 197.5,-413 197.5,-354 197.5,-354 197.5,-348 203.5,-342 209.5,-342 209.5,-342 317.5,-342 317.5,-342 323.5,-342 329.5,-348 329.5,-354 329.5,-354 329.5,-413 329.5,-413 329.5,-419 323.5,-425 317.5,-425\"/>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">类黄酮 &lt;= 2.31</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 1.569</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 124</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 47, 33]</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 1 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>1</title>\n",
       "<path fill=\"#e5fcee\" stroke=\"black\" d=\"M245.5,-306C245.5,-306 141.5,-306 141.5,-306 135.5,-306 129.5,-300 129.5,-294 129.5,-294 129.5,-235 129.5,-235 129.5,-229 135.5,-223 141.5,-223 141.5,-223 245.5,-223 245.5,-223 251.5,-223 257.5,-229 257.5,-235 257.5,-235 257.5,-294 257.5,-294 257.5,-300 251.5,-306 245.5,-306\"/>\n",
       "<text text-anchor=\"middle\" x=\"193.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">颜 色强度 &lt;= 3.95</text>\n",
       "<text text-anchor=\"middle\" x=\"193.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.996</text>\n",
       "<text text-anchor=\"middle\" x=\"193.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 71</text>\n",
       "<text text-anchor=\"middle\" x=\"193.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 38, 33]</text>\n",
       "<text text-anchor=\"middle\" x=\"193.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;1 -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>0&#45;&gt;1</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M239.21,-341.91C233.95,-333.1 228.32,-323.7 222.88,-314.61\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"225.88,-312.81 217.74,-306.02 219.87,-316.4 225.88,-312.81\"/>\n",
       "<text text-anchor=\"middle\" x=\"211.65\" y=\"-326.57\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">True</text>\n",
       "</g>\n",
       "<!-- 6 -->\n",
       "<g id=\"node7\" class=\"node\">\n",
       "<title>6</title>\n",
       "<path fill=\"#ea9b61\" stroke=\"black\" d=\"M381,-306C381,-306 288,-306 288,-306 282,-306 276,-300 276,-294 276,-294 276,-235 276,-235 276,-229 282,-223 288,-223 288,-223 381,-223 381,-223 387,-223 393,-229 393,-235 393,-235 393,-294 393,-294 393,-300 387,-306 381,-306\"/>\n",
       "<text text-anchor=\"middle\" x=\"334.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">脯氨酸 &lt;= 707.5</text>\n",
       "<text text-anchor=\"middle\" x=\"334.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.657</text>\n",
       "<text text-anchor=\"middle\" x=\"334.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 53</text>\n",
       "<text text-anchor=\"middle\" x=\"334.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 9, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"334.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 琴酒</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;6 -->\n",
       "<g id=\"edge6\" class=\"edge\">\n",
       "<title>0&#45;&gt;6</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M288.13,-341.91C293.47,-333.1 299.18,-323.7 304.7,-314.61\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"307.71,-316.39 309.91,-306.02 301.73,-312.75 307.71,-316.39\"/>\n",
       "<text text-anchor=\"middle\" x=\"315.85\" y=\"-326.6\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">False</text>\n",
       "</g>\n",
       "<!-- 2 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>2</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M105,-179.5C105,-179.5 12,-179.5 12,-179.5 6,-179.5 0,-173.5 0,-167.5 0,-167.5 0,-123.5 0,-123.5 0,-117.5 6,-111.5 12,-111.5 12,-111.5 105,-111.5 105,-111.5 111,-111.5 117,-117.5 117,-123.5 117,-123.5 117,-167.5 117,-167.5 117,-173.5 111,-179.5 105,-179.5\"/>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 34</text>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 34, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;2 -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>1&#45;&gt;2</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M146.66,-222.91C133.04,-211.1 118.17,-198.22 104.6,-186.45\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"106.62,-183.57 96.77,-179.67 102.03,-188.86 106.62,-183.57\"/>\n",
       "</g>\n",
       "<!-- 3 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>3</title>\n",
       "<path fill=\"#9051e8\" stroke=\"black\" d=\"M243.5,-187C243.5,-187 147.5,-187 147.5,-187 141.5,-187 135.5,-181 135.5,-175 135.5,-175 135.5,-116 135.5,-116 135.5,-110 141.5,-104 147.5,-104 147.5,-104 243.5,-104 243.5,-104 249.5,-104 255.5,-110 255.5,-116 255.5,-116 255.5,-175 255.5,-175 255.5,-181 249.5,-187 243.5,-187\"/>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">类黄酮 &lt;= 1.4</text>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.494</text>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 37</text>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 4, 33]</text>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;3 -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>1&#45;&gt;3</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M194.19,-222.91C194.34,-214.56 194.49,-205.67 194.64,-197.02\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"198.14,-197.08 194.81,-187.02 191.14,-196.96 198.14,-197.08\"/>\n",
       "</g>\n",
       "<!-- 4 -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>4</title>\n",
       "<path fill=\"#8139e5\" stroke=\"black\" d=\"M182.5,-68C182.5,-68 86.5,-68 86.5,-68 80.5,-68 74.5,-62 74.5,-56 74.5,-56 74.5,-12 74.5,-12 74.5,-6 80.5,0 86.5,0 86.5,0 182.5,0 182.5,0 188.5,0 194.5,-6 194.5,-12 194.5,-12 194.5,-56 194.5,-56 194.5,-62 188.5,-68 182.5,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"134.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"134.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 33</text>\n",
       "<text text-anchor=\"middle\" x=\"134.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 0, 33]</text>\n",
       "<text text-anchor=\"middle\" x=\"134.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 3&#45;&gt;4 -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>3&#45;&gt;4</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M172.79,-103.73C167.96,-95.06 162.85,-85.9 158,-77.18\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"160.97,-75.33 153.05,-68.3 154.86,-78.74 160.97,-75.33\"/>\n",
       "</g>\n",
       "<!-- 5 -->\n",
       "<g id=\"node6\" class=\"node\">\n",
       "<title>5</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M310.5,-68C310.5,-68 224.5,-68 224.5,-68 218.5,-68 212.5,-62 212.5,-56 212.5,-56 212.5,-12 212.5,-12 212.5,-6 218.5,0 224.5,0 224.5,0 310.5,0 310.5,0 316.5,0 322.5,-6 322.5,-12 322.5,-12 322.5,-56 322.5,-56 322.5,-62 316.5,-68 310.5,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"267.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"267.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 4</text>\n",
       "<text text-anchor=\"middle\" x=\"267.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 4, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"267.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 3&#45;&gt;5 -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>3&#45;&gt;5</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M222.31,-103.73C228.07,-94.97 234.16,-85.7 239.95,-76.91\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"243.03,-78.58 245.6,-68.3 237.19,-74.73 243.03,-78.58\"/>\n",
       "</g>\n",
       "<!-- 7 -->\n",
       "<g id=\"node8\" class=\"node\">\n",
       "<title>7</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M375.5,-179.5C375.5,-179.5 289.5,-179.5 289.5,-179.5 283.5,-179.5 277.5,-173.5 277.5,-167.5 277.5,-167.5 277.5,-123.5 277.5,-123.5 277.5,-117.5 283.5,-111.5 289.5,-111.5 289.5,-111.5 375.5,-111.5 375.5,-111.5 381.5,-111.5 387.5,-117.5 387.5,-123.5 387.5,-123.5 387.5,-167.5 387.5,-167.5 387.5,-173.5 381.5,-179.5 375.5,-179.5\"/>\n",
       "<text text-anchor=\"middle\" x=\"332.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"332.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 8</text>\n",
       "<text text-anchor=\"middle\" x=\"332.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 8, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"332.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 6&#45;&gt;7 -->\n",
       "<g id=\"edge7\" class=\"edge\">\n",
       "<title>6&#45;&gt;7</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M333.81,-222.91C333.62,-212.2 333.43,-200.62 333.24,-189.78\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"336.74,-189.61 333.07,-179.67 329.74,-189.73 336.74,-189.61\"/>\n",
       "</g>\n",
       "<!-- 8 -->\n",
       "<g id=\"node9\" class=\"node\">\n",
       "<title>8</title>\n",
       "<path fill=\"#e6843d\" stroke=\"black\" d=\"M529,-187C529,-187 418,-187 418,-187 412,-187 406,-181 406,-175 406,-175 406,-116 406,-116 406,-110 412,-104 418,-104 418,-104 529,-104 529,-104 535,-104 541,-110 541,-116 541,-116 541,-175 541,-175 541,-181 535,-187 529,-187\"/>\n",
       "<text text-anchor=\"middle\" x=\"473.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">颜 色强度 &lt;= 3.465</text>\n",
       "<text text-anchor=\"middle\" x=\"473.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.154</text>\n",
       "<text text-anchor=\"middle\" x=\"473.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 45</text>\n",
       "<text text-anchor=\"middle\" x=\"473.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 1, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"473.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 琴酒</text>\n",
       "</g>\n",
       "<!-- 6&#45;&gt;8 -->\n",
       "<g id=\"edge8\" class=\"edge\">\n",
       "<title>6&#45;&gt;8</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M382.73,-222.91C393.94,-213.47 405.97,-203.34 417.49,-193.65\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"419.96,-196.14 425.36,-187.02 415.46,-190.78 419.96,-196.14\"/>\n",
       "</g>\n",
       "<!-- 9 -->\n",
       "<g id=\"node10\" class=\"node\">\n",
       "<title>9</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M445.5,-68C445.5,-68 359.5,-68 359.5,-68 353.5,-68 347.5,-62 347.5,-56 347.5,-56 347.5,-12 347.5,-12 347.5,-6 353.5,0 359.5,0 359.5,0 445.5,0 445.5,0 451.5,0 457.5,-6 457.5,-12 457.5,-12 457.5,-56 457.5,-56 457.5,-62 451.5,-68 445.5,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 1</text>\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 1, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"402.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 8&#45;&gt;9 -->\n",
       "<g id=\"edge9\" class=\"edge\">\n",
       "<title>8&#45;&gt;9</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M447.06,-103.73C441.38,-94.97 435.38,-85.7 429.67,-76.91\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"432.47,-74.79 424.09,-68.3 426.6,-78.59 432.47,-74.79\"/>\n",
       "</g>\n",
       "<!-- 10 -->\n",
       "<g id=\"node11\" class=\"node\">\n",
       "<title>10</title>\n",
       "<path fill=\"#e58139\" stroke=\"black\" d=\"M581,-68C581,-68 488,-68 488,-68 482,-68 476,-62 476,-56 476,-56 476,-12 476,-12 476,-6 482,0 488,0 488,0 581,0 581,0 587,0 593,-6 593,-12 593,-12 593,-56 593,-56 593,-62 587,-68 581,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"534.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"534.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 44</text>\n",
       "<text text-anchor=\"middle\" x=\"534.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 0, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"534.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 琴酒</text>\n",
       "</g>\n",
       "<!-- 8&#45;&gt;10 -->\n",
       "<g id=\"edge10\" class=\"edge\">\n",
       "<title>8&#45;&gt;10</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M496.21,-103.73C501.04,-95.06 506.15,-85.9 511,-77.18\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"514.14,-78.74 515.95,-68.3 508.03,-75.33 514.14,-78.74\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x7fbd76a822e8>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train, y_train, x_test, y_test = load_data()\n",
    "model = build_model()\n",
    "model.fit(x_train, y_train)\n",
    "score = model.score(x_test, y_test)\n",
    "print(score)\n",
    "\n",
    "graph = plot_tree(model)\n",
    "graph"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.        , 0.        , 0.        , 0.        , 0.        ,\n",
       "       0.        , 0.55134708, 0.        , 0.        , 0.30517551,\n",
       "       0.        , 0.        , 0.14347741])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.feature_importances_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('酒精', 0.0),\n",
       " ('苹果酸', 0.0),\n",
       " ('灰', 0.0),\n",
       " ('灰的碱性', 0.0),\n",
       " ('镁', 0.0),\n",
       " ('总酚', 0.0),\n",
       " ('类黄酮', 0.5513470812080731),\n",
       " ('非黄烷类酚类', 0.0),\n",
       " ('花青素', 0.0),\n",
       " ('颜 色强度', 0.30517550806610544),\n",
       " ('色调', 0.0),\n",
       " ('od280/od315稀释葡萄酒', 0.0),\n",
       " ('脯氨酸', 0.1434774107258215)]"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[*zip(feature_name,model.feature_importances_)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9074074074074074"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model = tree.DecisionTreeClassifier(criterion=\"entropy\", random_state=30)\n",
    "model = model.fit(x_train, y_train)\n",
    "score = model.score(x_test, y_test)\n",
    "score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8703703703703703"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model = tree.DecisionTreeClassifier(criterion=\"entropy\", \n",
    "                                    random_state=30,\n",
    "                                    splitter=\"random\"\n",
    "                                   )\n",
    "model = model.fit(x_train, y_train)\n",
    "score = model.score(x_test, y_test)\n",
    "score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "# 设置剪枝"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "clf = tree.DecisionTreeClassifier(criterion=\"entropy\"\n",
    "                                  ,random_state=30\n",
    "                                  ,splitter=\"random\"\n",
    "                                  ,max_depth=4\n",
    "#                                   ,min_samples_leaf=10\n",
    "#                                   ,min_samples_split=10\n",
    "                                )\n",
    "clf = clf.fit(x_train, y_train)\n",
    "dot_data = tree.export_graphviz(clf\n",
    "                                ,feature_names= feature_name\n",
    "                                ,class_names=[\"琴酒\",\"雪莉\",\"贝尔摩德\"]\n",
    "                                ,filled=True\n",
    "                                ,rounded=True\n",
    "                                )\n",
    "graph = graphviz.Source(dot_data)\n",
    "graph"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "score = clf.score(x_test, y_test)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "score"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "markdown",
   "source": [
    "# 按照深度绘制准确率曲线"
   ],
   "metadata": {
    "collapsed": false
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "test = []\n",
    "for i in range(10):\n",
    "    clf = tree.DecisionTreeClassifier(max_depth = i+1,\n",
    "                                     criterion='entropy',\n",
    "                                     random_state=30,\n",
    "                                     splitter=\"random\")\n",
    "    clf.fit(x_train, y_train)\n",
    "    score = clf.score(x_test, y_test)\n",
    "    test.append(score)\n",
    "plt.plot(range(1,11), test, color=\"red\", label=\"max_depth\")\n",
    "plt.legend()\n",
    "plt.show()"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "clf.apply(x_test)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "clf.predict(x_test)"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.42.3 (20191010.1750)\n",
       " -->\n",
       "<!-- Title: Tree Pages: 1 -->\n",
       "<svg width=\"1041pt\" height=\"552pt\"\n",
       " viewBox=\"0.00 0.00 1041.00 552.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 548)\">\n",
       "<title>Tree</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-548 1037,-548 1037,4 -4,4\"/>\n",
       "<!-- 0 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>0</title>\n",
       "<path fill=\"#f8fefa\" stroke=\"black\" d=\"M615.5,-544C615.5,-544 507.5,-544 507.5,-544 501.5,-544 495.5,-538 495.5,-532 495.5,-532 495.5,-473 495.5,-473 495.5,-467 501.5,-461 507.5,-461 507.5,-461 615.5,-461 615.5,-461 621.5,-461 627.5,-467 627.5,-473 627.5,-473 627.5,-532 627.5,-532 627.5,-538 621.5,-544 615.5,-544\"/>\n",
       "<text text-anchor=\"middle\" x=\"561.5\" y=\"-528.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">类黄酮 &lt;= 1.714</text>\n",
       "<text text-anchor=\"middle\" x=\"561.5\" y=\"-513.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 1.569</text>\n",
       "<text text-anchor=\"middle\" x=\"561.5\" y=\"-498.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 124</text>\n",
       "<text text-anchor=\"middle\" x=\"561.5\" y=\"-483.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 47, 33]</text>\n",
       "<text text-anchor=\"middle\" x=\"561.5\" y=\"-468.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 1 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>1</title>\n",
       "<path fill=\"#be99f2\" stroke=\"black\" d=\"M498,-425C498,-425 397,-425 397,-425 391,-425 385,-419 385,-413 385,-413 385,-354 385,-354 385,-348 391,-342 397,-342 397,-342 498,-342 498,-342 504,-342 510,-348 510,-354 510,-354 510,-413 510,-413 510,-419 504,-425 498,-425\"/>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">酒精 &lt;= 12.675</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.911</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 49</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 16, 33]</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;1 -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>0&#45;&gt;1</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M521.95,-460.91C512.93,-451.65 503.26,-441.73 493.99,-432.21\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"496.47,-429.74 486.98,-425.02 491.45,-434.63 496.47,-429.74\"/>\n",
       "<text text-anchor=\"middle\" x=\"486.66\" y=\"-446.32\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">True</text>\n",
       "</g>\n",
       "<!-- 12 -->\n",
       "<g id=\"node13\" class=\"node\">\n",
       "<title>12</title>\n",
       "<path fill=\"#f7dac4\" stroke=\"black\" d=\"M663,-425C663,-425 562,-425 562,-425 556,-425 550,-419 550,-413 550,-413 550,-354 550,-354 550,-348 556,-342 562,-342 562,-342 663,-342 663,-342 669,-342 675,-348 675,-354 675,-354 675,-413 675,-413 675,-419 669,-425 663,-425\"/>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-409.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">酒精 &lt;= 12.754</text>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-394.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.978</text>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-379.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 75</text>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-364.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 31, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-349.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 琴酒</text>\n",
       "</g>\n",
       "<!-- 0&#45;&gt;12 -->\n",
       "<g id=\"edge12\" class=\"edge\">\n",
       "<title>0&#45;&gt;12</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M579.19,-460.91C582.91,-452.38 586.88,-443.28 590.72,-434.46\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"594.05,-435.59 594.84,-425.02 587.63,-432.79 594.05,-435.59\"/>\n",
       "<text text-anchor=\"middle\" x=\"603.98\" y=\"-444.59\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">False</text>\n",
       "</g>\n",
       "<!-- 2 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>2</title>\n",
       "<path fill=\"#76eda8\" stroke=\"black\" d=\"M315.5,-306C315.5,-306 211.5,-306 211.5,-306 205.5,-306 199.5,-300 199.5,-294 199.5,-294 199.5,-235 199.5,-235 199.5,-229 205.5,-223 211.5,-223 211.5,-223 315.5,-223 315.5,-223 321.5,-223 327.5,-229 327.5,-235 327.5,-235 327.5,-294 327.5,-294 327.5,-300 321.5,-306 315.5,-306\"/>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">颜 色强度 &lt;= 6.37</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.787</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 17</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 13, 4]</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;2 -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>1&#45;&gt;2</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M384.95,-342.73C369.3,-332.78 352.38,-322.02 336.29,-311.78\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"337.76,-308.57 327.44,-306.16 334,-314.48 337.76,-308.57\"/>\n",
       "</g>\n",
       "<!-- 7 -->\n",
       "<g id=\"node8\" class=\"node\">\n",
       "<title>7</title>\n",
       "<path fill=\"#8e4de8\" stroke=\"black\" d=\"M495.5,-306C495.5,-306 399.5,-306 399.5,-306 393.5,-306 387.5,-300 387.5,-294 387.5,-294 387.5,-235 387.5,-235 387.5,-229 393.5,-223 399.5,-223 399.5,-223 495.5,-223 495.5,-223 501.5,-223 507.5,-229 507.5,-235 507.5,-235 507.5,-294 507.5,-294 507.5,-300 501.5,-306 495.5,-306\"/>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">类黄酮 &lt;= 1.21</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.449</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 32</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 3, 29]</text>\n",
       "<text text-anchor=\"middle\" x=\"447.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 1&#45;&gt;7 -->\n",
       "<g id=\"edge7\" class=\"edge\">\n",
       "<title>1&#45;&gt;7</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M447.5,-341.91C447.5,-333.65 447.5,-324.86 447.5,-316.3\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"451,-316.02 447.5,-306.02 444,-316.02 451,-316.02\"/>\n",
       "</g>\n",
       "<!-- 3 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>3</title>\n",
       "<path fill=\"#48e78b\" stroke=\"black\" d=\"M173,-187C173,-187 80,-187 80,-187 74,-187 68,-181 68,-175 68,-175 68,-116 68,-116 68,-110 74,-104 80,-104 80,-104 173,-104 173,-104 179,-104 185,-110 185,-116 185,-116 185,-175 185,-175 185,-181 179,-187 173,-187\"/>\n",
       "<text text-anchor=\"middle\" x=\"126.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">苹果酸 &lt;= 3.934</text>\n",
       "<text text-anchor=\"middle\" x=\"126.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.371</text>\n",
       "<text text-anchor=\"middle\" x=\"126.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 14</text>\n",
       "<text text-anchor=\"middle\" x=\"126.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 13, 1]</text>\n",
       "<text text-anchor=\"middle\" x=\"126.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 2&#45;&gt;3 -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>2&#45;&gt;3</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M215.97,-222.91C204.92,-213.47 193.06,-203.34 181.71,-193.65\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"183.82,-190.85 173.95,-187.02 179.28,-196.18 183.82,-190.85\"/>\n",
       "</g>\n",
       "<!-- 6 -->\n",
       "<g id=\"node7\" class=\"node\">\n",
       "<title>6</title>\n",
       "<path fill=\"#8139e5\" stroke=\"black\" d=\"M311.5,-179.5C311.5,-179.5 215.5,-179.5 215.5,-179.5 209.5,-179.5 203.5,-173.5 203.5,-167.5 203.5,-167.5 203.5,-123.5 203.5,-123.5 203.5,-117.5 209.5,-111.5 215.5,-111.5 215.5,-111.5 311.5,-111.5 311.5,-111.5 317.5,-111.5 323.5,-117.5 323.5,-123.5 323.5,-123.5 323.5,-167.5 323.5,-167.5 323.5,-173.5 317.5,-179.5 311.5,-179.5\"/>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 3</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 0, 3]</text>\n",
       "<text text-anchor=\"middle\" x=\"263.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 2&#45;&gt;6 -->\n",
       "<g id=\"edge6\" class=\"edge\">\n",
       "<title>2&#45;&gt;6</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M263.5,-222.91C263.5,-212.2 263.5,-200.62 263.5,-189.78\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"267,-189.67 263.5,-179.67 260,-189.67 267,-189.67\"/>\n",
       "</g>\n",
       "<!-- 4 -->\n",
       "<g id=\"node5\" class=\"node\">\n",
       "<title>4</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M105,-68C105,-68 12,-68 12,-68 6,-68 0,-62 0,-56 0,-56 0,-12 0,-12 0,-6 6,0 12,0 12,0 105,0 105,0 111,0 117,-6 117,-12 117,-12 117,-56 117,-56 117,-62 111,-68 105,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 13</text>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 13, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"58.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 3&#45;&gt;4 -->\n",
       "<g id=\"edge4\" class=\"edge\">\n",
       "<title>3&#45;&gt;4</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M101.18,-103.73C95.74,-94.97 89.99,-85.7 84.52,-76.91\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"87.43,-74.95 79.18,-68.3 81.48,-78.64 87.43,-74.95\"/>\n",
       "</g>\n",
       "<!-- 5 -->\n",
       "<g id=\"node6\" class=\"node\">\n",
       "<title>5</title>\n",
       "<path fill=\"#8139e5\" stroke=\"black\" d=\"M243.5,-68C243.5,-68 147.5,-68 147.5,-68 141.5,-68 135.5,-62 135.5,-56 135.5,-56 135.5,-12 135.5,-12 135.5,-6 141.5,0 147.5,0 147.5,0 243.5,0 243.5,0 249.5,0 255.5,-6 255.5,-12 255.5,-12 255.5,-56 255.5,-56 255.5,-62 249.5,-68 243.5,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 1</text>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 0, 1]</text>\n",
       "<text text-anchor=\"middle\" x=\"195.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 3&#45;&gt;5 -->\n",
       "<g id=\"edge5\" class=\"edge\">\n",
       "<title>3&#45;&gt;5</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M152.19,-103.73C157.71,-94.97 163.55,-85.7 169.09,-76.91\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"172.15,-78.63 174.52,-68.3 166.22,-74.89 172.15,-78.63\"/>\n",
       "</g>\n",
       "<!-- 8 -->\n",
       "<g id=\"node9\" class=\"node\">\n",
       "<title>8</title>\n",
       "<path fill=\"#8139e5\" stroke=\"black\" d=\"M449.5,-179.5C449.5,-179.5 353.5,-179.5 353.5,-179.5 347.5,-179.5 341.5,-173.5 341.5,-167.5 341.5,-167.5 341.5,-123.5 341.5,-123.5 341.5,-117.5 347.5,-111.5 353.5,-111.5 353.5,-111.5 449.5,-111.5 449.5,-111.5 455.5,-111.5 461.5,-117.5 461.5,-123.5 461.5,-123.5 461.5,-167.5 461.5,-167.5 461.5,-173.5 455.5,-179.5 449.5,-179.5\"/>\n",
       "<text text-anchor=\"middle\" x=\"401.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"401.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 23</text>\n",
       "<text text-anchor=\"middle\" x=\"401.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 0, 23]</text>\n",
       "<text text-anchor=\"middle\" x=\"401.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 7&#45;&gt;8 -->\n",
       "<g id=\"edge8\" class=\"edge\">\n",
       "<title>7&#45;&gt;8</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M431.54,-222.91C427.25,-211.98 422.59,-200.14 418.25,-189.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"421.46,-187.69 414.54,-179.67 414.94,-190.25 421.46,-187.69\"/>\n",
       "</g>\n",
       "<!-- 9 -->\n",
       "<g id=\"node10\" class=\"node\">\n",
       "<title>9</title>\n",
       "<path fill=\"#c09cf2\" stroke=\"black\" d=\"M691.5,-187C691.5,-187 491.5,-187 491.5,-187 485.5,-187 479.5,-181 479.5,-175 479.5,-175 479.5,-116 479.5,-116 479.5,-110 485.5,-104 491.5,-104 491.5,-104 691.5,-104 691.5,-104 697.5,-104 703.5,-110 703.5,-116 703.5,-116 703.5,-175 703.5,-175 703.5,-181 697.5,-187 691.5,-187\"/>\n",
       "<text text-anchor=\"middle\" x=\"591.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">od280/od315稀释葡萄酒 &lt;= 1.693</text>\n",
       "<text text-anchor=\"middle\" x=\"591.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.918</text>\n",
       "<text text-anchor=\"middle\" x=\"591.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 9</text>\n",
       "<text text-anchor=\"middle\" x=\"591.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 3, 6]</text>\n",
       "<text text-anchor=\"middle\" x=\"591.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 7&#45;&gt;9 -->\n",
       "<g id=\"edge9\" class=\"edge\">\n",
       "<title>7&#45;&gt;9</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M497.46,-222.91C509.19,-213.38 521.78,-203.15 533.81,-193.37\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"536.07,-196.04 541.63,-187.02 531.66,-190.61 536.07,-196.04\"/>\n",
       "</g>\n",
       "<!-- 10 -->\n",
       "<g id=\"node11\" class=\"node\">\n",
       "<title>10</title>\n",
       "<path fill=\"#8139e5\" stroke=\"black\" d=\"M566.5,-68C566.5,-68 470.5,-68 470.5,-68 464.5,-68 458.5,-62 458.5,-56 458.5,-56 458.5,-12 458.5,-12 458.5,-6 464.5,0 470.5,0 470.5,0 566.5,0 566.5,0 572.5,0 578.5,-6 578.5,-12 578.5,-12 578.5,-56 578.5,-56 578.5,-62 572.5,-68 566.5,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"518.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"518.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 5</text>\n",
       "<text text-anchor=\"middle\" x=\"518.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 0, 5]</text>\n",
       "<text text-anchor=\"middle\" x=\"518.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 贝尔摩德</text>\n",
       "</g>\n",
       "<!-- 9&#45;&gt;10 -->\n",
       "<g id=\"edge10\" class=\"edge\">\n",
       "<title>9&#45;&gt;10</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M564.32,-103.73C558.42,-94.88 552.17,-85.51 546.25,-76.63\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"549.16,-74.68 540.7,-68.3 543.33,-78.56 549.16,-74.68\"/>\n",
       "</g>\n",
       "<!-- 11 -->\n",
       "<g id=\"node12\" class=\"node\">\n",
       "<title>11</title>\n",
       "<path fill=\"#7beeab\" stroke=\"black\" d=\"M696,-68C696,-68 609,-68 609,-68 603,-68 597,-62 597,-56 597,-56 597,-12 597,-12 597,-6 603,0 609,0 609,0 696,0 696,0 702,0 708,-6 708,-12 708,-12 708,-56 708,-56 708,-62 702,-68 696,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"652.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.811</text>\n",
       "<text text-anchor=\"middle\" x=\"652.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 4</text>\n",
       "<text text-anchor=\"middle\" x=\"652.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 3, 1]</text>\n",
       "<text text-anchor=\"middle\" x=\"652.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 9&#45;&gt;11 -->\n",
       "<g id=\"edge11\" class=\"edge\">\n",
       "<title>9&#45;&gt;11</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M614.21,-103.73C619.04,-95.06 624.15,-85.9 629,-77.18\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"632.14,-78.74 633.95,-68.3 626.03,-75.33 632.14,-78.74\"/>\n",
       "</g>\n",
       "<!-- 13 -->\n",
       "<g id=\"node14\" class=\"node\">\n",
       "<title>13</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M659,-298.5C659,-298.5 566,-298.5 566,-298.5 560,-298.5 554,-292.5 554,-286.5 554,-286.5 554,-242.5 554,-242.5 554,-236.5 560,-230.5 566,-230.5 566,-230.5 659,-230.5 659,-230.5 665,-230.5 671,-236.5 671,-242.5 671,-242.5 671,-286.5 671,-286.5 671,-292.5 665,-298.5 659,-298.5\"/>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-283.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-268.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 26</text>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-253.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 26, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"612.5\" y=\"-238.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 12&#45;&gt;13 -->\n",
       "<g id=\"edge13\" class=\"edge\">\n",
       "<title>12&#45;&gt;13</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M612.5,-341.91C612.5,-331.2 612.5,-319.62 612.5,-308.78\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"616,-308.67 612.5,-298.67 609,-308.67 616,-308.67\"/>\n",
       "</g>\n",
       "<!-- 14 -->\n",
       "<g id=\"node15\" class=\"node\">\n",
       "<title>14</title>\n",
       "<path fill=\"#e88f50\" stroke=\"black\" d=\"M830.5,-306C830.5,-306 722.5,-306 722.5,-306 716.5,-306 710.5,-300 710.5,-294 710.5,-294 710.5,-235 710.5,-235 710.5,-229 716.5,-223 722.5,-223 722.5,-223 830.5,-223 830.5,-223 836.5,-223 842.5,-229 842.5,-235 842.5,-235 842.5,-294 842.5,-294 842.5,-300 836.5,-306 830.5,-306\"/>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-290.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">脯氨酸 &lt;= 495.916</text>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-275.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.475</text>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-260.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 49</text>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-245.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 5, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-230.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 琴酒</text>\n",
       "</g>\n",
       "<!-- 12&#45;&gt;14 -->\n",
       "<g id=\"edge14\" class=\"edge\">\n",
       "<title>12&#45;&gt;14</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M669.4,-341.91C682.88,-332.29 697.37,-321.95 711.19,-312.09\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"713.59,-314.68 719.7,-306.02 709.53,-308.98 713.59,-314.68\"/>\n",
       "</g>\n",
       "<!-- 15 -->\n",
       "<g id=\"node16\" class=\"node\">\n",
       "<title>15</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M819.5,-179.5C819.5,-179.5 733.5,-179.5 733.5,-179.5 727.5,-179.5 721.5,-173.5 721.5,-167.5 721.5,-167.5 721.5,-123.5 721.5,-123.5 721.5,-117.5 727.5,-111.5 733.5,-111.5 733.5,-111.5 819.5,-111.5 819.5,-111.5 825.5,-111.5 831.5,-117.5 831.5,-123.5 831.5,-123.5 831.5,-167.5 831.5,-167.5 831.5,-173.5 825.5,-179.5 819.5,-179.5\"/>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-164.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-149.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 2</text>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-134.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 2, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"776.5\" y=\"-119.3\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 14&#45;&gt;15 -->\n",
       "<g id=\"edge15\" class=\"edge\">\n",
       "<title>14&#45;&gt;15</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M776.5,-222.91C776.5,-212.2 776.5,-200.62 776.5,-189.78\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"780,-189.67 776.5,-179.67 773,-189.67 780,-189.67\"/>\n",
       "</g>\n",
       "<!-- 16 -->\n",
       "<g id=\"node17\" class=\"node\">\n",
       "<title>16</title>\n",
       "<path fill=\"#e78a46\" stroke=\"black\" d=\"M955,-187C955,-187 862,-187 862,-187 856,-187 850,-181 850,-175 850,-175 850,-116 850,-116 850,-110 856,-104 862,-104 862,-104 955,-104 955,-104 961,-104 967,-110 967,-116 967,-116 967,-175 967,-175 967,-181 961,-187 955,-187\"/>\n",
       "<text text-anchor=\"middle\" x=\"908.5\" y=\"-171.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">灰 &lt;= 1.834</text>\n",
       "<text text-anchor=\"middle\" x=\"908.5\" y=\"-156.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.342</text>\n",
       "<text text-anchor=\"middle\" x=\"908.5\" y=\"-141.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 47</text>\n",
       "<text text-anchor=\"middle\" x=\"908.5\" y=\"-126.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 3, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"908.5\" y=\"-111.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 琴酒</text>\n",
       "</g>\n",
       "<!-- 14&#45;&gt;16 -->\n",
       "<g id=\"edge16\" class=\"edge\">\n",
       "<title>14&#45;&gt;16</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M822.3,-222.91C832.84,-213.56 844.15,-203.54 854.99,-193.93\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"857.62,-196.27 862.78,-187.02 852.98,-191.03 857.62,-196.27\"/>\n",
       "</g>\n",
       "<!-- 17 -->\n",
       "<g id=\"node18\" class=\"node\">\n",
       "<title>17</title>\n",
       "<path fill=\"#39e581\" stroke=\"black\" d=\"M885.5,-68C885.5,-68 799.5,-68 799.5,-68 793.5,-68 787.5,-62 787.5,-56 787.5,-56 787.5,-12 787.5,-12 787.5,-6 793.5,0 799.5,0 799.5,0 885.5,0 885.5,0 891.5,0 897.5,-6 897.5,-12 897.5,-12 897.5,-56 897.5,-56 897.5,-62 891.5,-68 885.5,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"842.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.0</text>\n",
       "<text text-anchor=\"middle\" x=\"842.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 1</text>\n",
       "<text text-anchor=\"middle\" x=\"842.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [0, 1, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"842.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 雪莉</text>\n",
       "</g>\n",
       "<!-- 16&#45;&gt;17 -->\n",
       "<g id=\"edge17\" class=\"edge\">\n",
       "<title>16&#45;&gt;17</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M883.92,-103.73C878.65,-94.97 873.06,-85.7 867.76,-76.91\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"870.73,-75.06 862.57,-68.3 864.74,-78.67 870.73,-75.06\"/>\n",
       "</g>\n",
       "<!-- 18 -->\n",
       "<g id=\"node19\" class=\"node\">\n",
       "<title>18</title>\n",
       "<path fill=\"#e68742\" stroke=\"black\" d=\"M1021,-68C1021,-68 928,-68 928,-68 922,-68 916,-62 916,-56 916,-56 916,-12 916,-12 916,-6 922,0 928,0 928,0 1021,0 1021,0 1027,0 1033,-6 1033,-12 1033,-12 1033,-56 1033,-56 1033,-62 1027,-68 1021,-68\"/>\n",
       "<text text-anchor=\"middle\" x=\"974.5\" y=\"-52.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">entropy = 0.258</text>\n",
       "<text text-anchor=\"middle\" x=\"974.5\" y=\"-37.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">samples = 46</text>\n",
       "<text text-anchor=\"middle\" x=\"974.5\" y=\"-22.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">value = [44, 2, 0]</text>\n",
       "<text text-anchor=\"middle\" x=\"974.5\" y=\"-7.8\" font-family=\"Helvetica,sans-Serif\" font-size=\"14.00\">class = 琴酒</text>\n",
       "</g>\n",
       "<!-- 16&#45;&gt;18 -->\n",
       "<g id=\"edge18\" class=\"edge\">\n",
       "<title>16&#45;&gt;18</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M933.08,-103.73C938.35,-94.97 943.94,-85.7 949.24,-76.91\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"952.26,-78.67 954.43,-68.3 946.27,-75.06 952.26,-78.67\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<graphviz.files.Source at 0x7fbd769d4400>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "score = clf.score(x_test, y_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9629629629629629"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 按照深度绘制准确率曲线"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dfXhU5Z3/8feXAAIRFRR8AJVoEUERCilqURFRpFKlWqygbZFaER+2tPvbWvVaRW2322t1rXaNIlXBVjSRp4qKgkVr1BUlQCoBRLMRMKLyIKIiCCHf3x/3IEMIZEJmciYzn9d15cqcp5nvjPKZk/vc577N3RERkczVLOoCREQktRT0IiIZTkEvIpLhFPQiIhlOQS8ikuGaR11AbQ477DDv0qVL1GWIiDQZCxcuXO/uHWrblpZB36VLF0pKSqIuQ0SkyTCzVXvbpqYbEZEMp6AXEclwCnoRkQyXlm30ItL0bN++ncrKSrZu3Rp1KRmtVatWdO7cmRYtWiR8jIJeRJKisrKStm3b0qVLF8ws6nIykruzYcMGKisrycvLS/g4Nd2ISFJs3bqVQw89VCGfQmbG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cNOhz2J3+jx2p89jl4Z8Fse6e61dFtMy6DOBmZXsrb0s2+iz2J0+j93p89glVZ+Fmm5ERDKcgl5EJMMp6FNnYtQFpBF9FrvT57E7fR67pOSzUBu9iEiG0xm9iEiGU9CLiGQ4BX0SmdnRZvaymS03s6VmNi7qmqJmZjlmttjMno26lqiZ2SFmNs3M3on9P3J61DVFycx+Fft3UmZmT5pZq6hrakxm9qiZrTWzsrh17c3sRTN7L/a7XTJeS0GfXFXA/3P37sBpwPVm1iPimqI2DlgedRFp4j7gBXc/EehFFn8uZtYJ+AWQ7+4nEwZMHBFtVY1uMjCkxrqbgHnu3hWYF1tuMAV9Ern7R+6+KPb4C8I/5Npm48oKZtYZGAo8HHUtUTOzg4CzgEcA3H2bu38WbVWRaw60NrPmQBtqzHOR6WITMH1aY/Uw4LHY48eAHyTjtRT0KWJmXYBvA29GW0mk7gVuBKqjLiQNHAesAybFmrIejs3RkJXc/UPgbmA18BGwyd3nRltVWjjc3T+CcOIIdEzGkyroU8DMDgSmA79098+jricKZvZ9YK27L4y6ljTRHOgDPOju3wY2k6Q/y5uiWNvzMCAPOArINbMfR1tV5lLQJ5mZtSCE/BR3nxF1PRHqD1xkZiuBQuAcM3s82pIiVQlUuvvOv/CmEYI/W50LvO/u69x9OzAD+G7ENaWDT8zsSIDY77XJeFIFfRLFplN8BFju7vdEXU+U3P1md+/s7l0IF9lecvesPWNz94+BD8ysW2zVIGBZhCVFbTVwmpm1if27GUQWX5yOMwsYFXs8Cng6GU9a51SCUi/9gZ8AS8ysNLbultiE6SL/AkyJzb1cAYyOuJ7IuPubZjYNWETorbaYLBsKwcyeBM4GDjOzSmA88AfgKTO7ivBleGlSXktDIIiIZDY13YiIZDgFvYhIhlPQi4hkOAW9iEiGU9CLiGQ4Bb2ISIZT0IuIZLj/D8uABK2Us7w0AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "test = []\n",
    "for i in range(10):\n",
    "    clf = tree.DecisionTreeClassifier(max_depth = i+1,\n",
    "                                     criterion='entropy',\n",
    "                                     random_state=30,\n",
    "                                     splitter=\"random\")\n",
    "    clf.fit(x_train, y_train)\n",
    "    score = clf.score(x_test, y_test)\n",
    "    test.append(score)\n",
    "plt.plot(range(1,11), test, color=\"red\", label=\"max_depth\")\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 8, 18,  4, 13,  4, 13, 13, 13, 13, 18, 13, 18,  4,  6, 13, 18, 13,\n",
       "       18, 15, 13, 13, 18,  4, 13,  8, 18, 11, 15, 13,  4, 18, 18,  8, 18,\n",
       "        4,  6,  8, 10,  8, 18,  8,  4,  8, 18, 13,  4, 18,  8, 13, 18, 18,\n",
       "        5,  8, 13])"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.apply(x_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([2, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1, 1, 1, 0,\n",
       "       1, 1, 2, 0, 1, 1, 1, 1, 0, 0, 2, 0, 1, 2, 2, 2, 2, 0, 2, 1, 2, 0,\n",
       "       1, 1, 0, 2, 1, 0, 0, 2, 2, 1])"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "clf.predict(x_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}